
<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <title>VDR-STREAMER-Video-Convert</title>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

 </head>
    <body>

<div>	
<script>

var statuscolormap = {};

function server_name(){
	var url = window.location.href;
	var index = url.lastIndexOf("/");
	if(index<0)
	{
		return url;
	}
	return url.substring(0,index);
}

function epocToHuman(epoc)
{
	var date = new Date( parseFloat(epoc) *1000 );
	return date.toLocaleDateString() + " " + date.toLocaleTimeString();
}



function delete_cmd(idObj, file)
{
	var r=confirm("Hi dude, Do you really want to do this???");
	if(!r)
	{
		return;
	}
	$.get("convert.run?delete=" + file, null);

	document.getElementById("parent_" + idObj).removeChild(document.getElementById("child_" + idObj));
}

function printVideos(data)
{
	document.write( "Server: " + server_name() + "<br>");
	document.write("<a href=\"index.html\">index.html</a><br>");
	document.write("<a href=\"convert.html\">Convert videos to avi</a><br><br><br><br>");

	var lines = data.split("\n");
	var id = 0;
	for(var i=0;i<lines.length;i++)
	{
		var params = lines[i].split(";");
		var name = params[1];
		var info = params[2];
		var description = params[3];
		var tmp = params[4].split("/");
		
		var filename = tmp[tmp.length-1];
		var link = "video/" + filename;
		id++;

		document.write("<div id=parent_" + id + ">");
		document.write("<div id=child_" + id + "><a href=\"" + link + "\" title=\"" + description + "\">" + filename + "</a>");

		var delete_cmd = ''

		document.write("<a onclick=\"delete_cmd(" + id + ", \'" + params[4] + "\')\"> Delete </a></div></div>");

	}
	document.write('</div>');
}

$.get("converted_videolist.txt",printVideos);

</script>

  



 </body>
</html>

